<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>js 基本语法</title>
	<script type="text/javascript">
		
	window.onload = function(){

		var oDiv = document.getElementById('div1');
		
		oDiv.title = "我看到了！";

		var oA = document.getElementById('link1');

		oA.href = "http://www.baidu.com";

		oA.title = "去到百度网";

		alert(oA.id);



	}




	</script>
</head>
<body>
	<div id="div1" class="div1" title="这是div元素，看到了吗？">这是一个div元素</div>
	<a href="#" id="link1">百度网</a>


</body>
</html>